package com.spring.ai.assistant;

import dev.langchain4j.service.MemoryId;
import dev.langchain4j.service.SystemMessage;
import dev.langchain4j.service.UserMessage;
import dev.langchain4j.service.spring.AiService;
import reactor.core.publisher.Flux;


import static dev.langchain4j.service.spring.AiServiceWiringMode.EXPLICIT;

/**
 * 接口描述: 调用大模型的接口
 * @author: kongmengmeng
 * @date: 2023/9/5 14:05
 * @description:
 */
@AiService(wiringMode = EXPLICIT, chatModel = "qwenChatModel",
          chatMemoryProvider = "chatMemoryProviderKongMen",
          tools = "kongMengAgentTools",
          contentRetriever = "contentRetrieverEmbedding"
          )
public interface KongMengAgent {

    @SystemMessage(fromResource = "medical_template.text")
    Flux<String> chat(@MemoryId Long memoryId, @UserMessage String message);

}
